import java.io.File;


public class DirTest {

	public static void main(String[] args) {
		
		if (args == null || args.length < 1) {
			System.err.println("Usages: java DirTest path");
			return;
		}

		validateLocation(args[0]);
	}
	
	private static void validateLocation(String path)
	{
		File file = new File(path);
		try {
			if (!file.exists() || !file.isDirectory()) {
				System.err.println("Oops! " + path + " not exist or not a directory");
			}
			else {
				System.out.println(path + " is a directory!");
			}
		} catch (Exception e) {
			System.err.println("Exception occurred checking the path " + path + ": " + e);
		}		
	}

}
